import { defineStore } from 'pinia'

const useAiChat = defineStore('useAiChat', {
  state: () => ({
    newChatFlag: false,
    historyChatFlag: false,
    allPromptFlag: false,
    chatWithRoleFlag: false,
    chatRoleInfo: null,
    someHistoryInfo: null
  }),
  getters: {},
  actions: {
    initAiChatState() {
      this.newChatFlag = false
      this.historyChatFlag = false
      this.allPromptFlag = false
      this.chatWithRoleFlag = false
      this.chatRoleInfo = null
      this.someHistoryInfo = null
    },
    createNewChat() {
      this.newChatFlag = true
      this.historyChatFlag = false
      this.allPromptFlag = false
      this.chatWithRoleFlag = false
      this.chatRoleInfo = null
      this.someHistoryInfo = null
    },
    checkAllPrompts() {
      this.allPromptFlag = true
      this.newChatFlag = false
      this.historyChatFlag = false
      this.chatWithRoleFlag = false
      this.chatRoleInfo = null
      this.someHistoryInfo = null
    },
    jumpToHistoryChat(historyChatInfo) {
      this.someHistoryInfo = historyChatInfo
      this.newChatFlag = false
      this.historyChatFlag = true
      this.allPromptFlag = false
      this.chatWithRoleFlag = false
      this.chatRoleInfo = null
    },
    jumpToChatWithRole(roleInfo) {
      this.chatWithRoleFlag = true
      this.chatRoleInfo = roleInfo
      this.someHistoryInfo = null
      this.newChatFlag = false
      this.historyChatFlag = false
      this.allPromptFlag = false
    }
  }
})

export default useAiChat
